﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="CheckOut.ascx.vb" Inherits="Control_Customer_CheckOut" %>
<script type='text/javascript'>
    function ajaxJquery() {
        $(function () {
            // register thickbox after postback
            var isAsyncPostback = Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack();
            if (isAsyncPostback) {
                tb_init('a.thickbox, area.thickbox, input.thickbox');
            }

            $(".Date").datepicker({ dateFormat: 'dd/mm/yy' });
            var url = '<%= ConfigurationManager.AppSettings("MainDomain") %>';

            $(".SubjectTitle input, .SubjectTitle select").keypress(function (e) {
                if (e.keyCode == 13) {
                    $("#<%=btnFilter.ClientID()%>").click();
                    return false;
                }
            });

            //check cookie to show or hide search pannel
            if ($.cookie('CookieSiteSearch') == 1) {
                $('#pnlSearch').show();
                $('#imgShowHide').attr("src", url + "images/arrow_popup.gif");
            }
            else {
                $('#pnlSearch').hide();
                $('#imgShowHide').attr("src", url + "images/arrow_showless.gif");
            }


            $('#B1').click(function (event) {

                //set cookie
                if ($.cookie('CookieSiteSearch') == 1) {
                    $.cookie('CookieSiteSearch', 0)
                }
                else {
                    $.cookie('CookieSiteSearch', 1)
                }
                $('#pnlSearch').slideToggle(500);
                if ($('#imgShowHide').attr("src") == url + "images/arrow_popup.gif") {
                    $('#imgShowHide').attr("src", url + "images/arrow_showless.gif");
                }
                else {
                    $('#imgShowHide').attr("src", url + "images/arrow_popup.gif");
                }
            });

        });

    }

    function confirmMultiDelete(strID) {
        var grdShow = document.getElementById("<%=grdShow.ClientID %>");
        var count = 0;
        for (i = 1; i < grdShow.children.item(0).children.length; i++) {
            if (grdShow.children.item(0).children.item(i).children.item(0).children.item(0).checked) {
                count += 1;
            }
        }
        if (count > 0) {
            return ComfirmDialog('<%=drpMessage.Items(1).Text%>', 0, strID, 0, 0);
        } else {
            Alertbox('<%=drpMessage.Items(2).Text%>');
            return false;
        }
    }
    function ComfirmDialog(strText, value, ObjectIdClick, ID, Type) {
        if (value == 0) {
            Confirmbox(strText, value, ObjectIdClick, ID, Type);
            return false;
        } else {
            if (Type == 1) {
                document.getElementById('<%=hidID.ClientID %>').value = ID;
                eval($("#" + ObjectIdClick + "").attr("href"));
            }
            else {

                $("#" + ObjectIdClick + "").click();
            }
        }
    }
    function confirmMultiChange(strID) {
        var grdShow = document.getElementById("<%=grdShow.ClientID %>");
        var count = 0;
        for (i = 1; i < grdShow.children.item(0).children.length; i++) {
            if (grdShow.children.item(0).children.item(i).children.item(0).children.item(0).checked) {
                count += 1;
            }
        }

        if (count > 0) {
            self.parent.tb_remove();
            $("#btnShowChangeMenu").click();
            return false;
        } else {
            Alertbox('<%=drpMessage.Items(2).Text%>');
            return false;
        }
    }

    //set Value hiddenfield


    function setChooseBranchNewsParentValue() {


        var id = $("#<% =txtCheckBoxDate.ClientID %>").val();
        $("#<% =hidCheckBoxDate.ClientID %>").val(id);
        self.parent.tb_remove();

        $("#<%=btnCapNhat.ClientId %>").click();

    }


</script>
<asp:UpdatePanel ID="uplCustomerList" runat="server">
    <ContentTemplate>
        <div class="HeadTitle">
            <h3>
                DANH SÁCH KHÁCH CHƯA CÓ CHECK OUT</h3>
        </div>
        <div class="SubjectTitle" id="SInfor" runat="server">
            <legend class="SubjectTitle">
                <img alt="" src="" id="imgShowHide" />
                <a id="B1" href="#">Tìm kiếm </a>&nbsp;&nbsp;</legend>
        </div>
        <div id="pnlSearch" class="SubjectTitle">
            <div>
                <div class="DivLeft">
                    <asp:Label ID="Label1" CssClass="TextLabel" runat="server" Text="Tên khách Hàng:" />
                </div>
                <div class="DivRight">
                    <asp:TextBox ID="txtCustomerName" CssClass="TextBox" runat="server" Text="" />
                </div>
            </div>
            <div>
                <div class="DivLeft">
                    <asp:Label ID="lblDescription" CssClass="TextLabel" runat="server" Text="Tạm trú từ ngày:" />
                </div>
                <div class="DivRight">
                    <asp:TextBox ID="txtFromDate" CssClass="TextBox Date" runat="server" Text="" />
                    <i>(dd/MM/yyyy)</i>
                </div>
            </div>
            <div>
                <div class="DivLeft">
                    <asp:Label ID="Label2" CssClass="TextLabel" runat="server" Text="Tạm trú đến ngày:" />
                </div>
                <div class="DivRight">
                    <asp:TextBox ID="txtToDate" CssClass="TextBox Date" runat="server" Text="" />
                    <i>(dd/MM/yyyy)</i>
                </div>
            </div>
            <div>
                <div class="DivLeft">
                    <asp:Label ID="lblAddress1" CssClass="TextLabel" runat="server" Text="Số hộ chiếu:" />
                </div>
                <div class="DivRight">
                    <asp:TextBox ID="txtPassportNumber" CssClass="TextBox" runat="server" Text="" />
                </div>
            </div>
            <div class="QuocTich">
                <div class="DivLeft">
                    <asp:Label ID="lblAddress2" CssClass="TextLabel" runat="server" Text="Quốc tịch:" />
                </div>
                <div class="DivRight">
                    <asp:DropDownList ID="ddlCountryCode" CssClass="DropDownList" runat="server" />
                </div>
            </div>
            <div style="display:none">
                <div class="DivLeft">
                    <asp:Label ID="Label3" CssClass="TextLabel" runat="server" Text="Trạng thái Check out:" />
                </div>
                <div class="DivRight">
                    <asp:DropDownList ID="ddlCheckOut" CssClass="DropDownList" runat="server" >
                        <asp:ListItem Value="-1" >---Tất cả---</asp:ListItem>
                        <asp:ListItem Value="1" >Có</asp:ListItem>
                        <asp:ListItem Value="0" >Chứa</asp:ListItem>
                    </asp:DropDownList>
                </div>
            </div>

            <div>
                <div class="DivLeft">
                    &nbsp;
                </div>
                <div class="DivRight">
                    <asp:Button ID="btnFilter" runat="server" Text='Tìm kiếm' CssClass='btn' />
                    <asp:Button ID="bnReset" runat="server" Text='Đặt lại' CssClass='btn' />
                </div>
            </div>
        </div>
        <asp:GridView ID="grdShow" runat="server" AutoGenerateColumns="False" EmptyDataText="{Không có dữ liệu}"
            AllowPaging="false" Width='100%' BorderWidth="1px" CssClass="GridBorder">
            <Columns>
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:CheckBox ID="CheckAll" runat="server" onclick="CheckAll(this);" Width="30px" />
                    </HeaderTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemTemplate>
                        <asp:CheckBox ID="chkItem" runat="server" />
                    </ItemTemplate>
                    <ItemStyle Width="5%" HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Stt">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="lblSTT" Text=''></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="4%" HorizontalAlign="Left" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText='Họ và tên'>
                    <ItemTemplate>
                        <asp:HyperLink ID="hplFullname" runat="server"></asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle Width='12%' CssClass='text_list_links' HorizontalAlign='Left' />
                </asp:TemplateField>
                <asp:BoundField DataField='DateOfBirth' HeaderText='Ngày sinh' DataFormatString="{0:dd/MM/yyyy}">
                    <ItemStyle Width='10%' />
                </asp:BoundField>
                <asp:BoundField DataField='CountryName' HeaderText='Quốc tịch'>
                    <ItemStyle Width='8%' />
                </asp:BoundField>
                <asp:BoundField DataField='PasspostNumber' HeaderText='Số hộ chiếu'>
                    <ItemStyle Width='10%' />
                </asp:BoundField>
                <asp:BoundField DataField='FromDate' HeaderText='Tạm trú từ ngày' DataFormatString="{0:dd/MM/yyyy}">
                    <ItemStyle Width='12%' />
                </asp:BoundField>
                <asp:BoundField DataField='ToDate' HeaderText='Tạm trú đến ngày' DataFormatString="{0:dd/MM/yyyy}">
                    <ItemStyle Width='12%' />
                </asp:BoundField>
                <asp:BoundField DataField='Created' HeaderText='Ngày nhập' DataFormatString="{0:dd/MM/yyyy HH:mm}">
                    <ItemStyle Width='10%' />
                </asp:BoundField>
                <asp:BoundField DataField='CheckOutDate' HeaderText='Check out' DataFormatString="{0:dd/MM/yyyy}">
                    <ItemStyle Width='10%' />
                </asp:BoundField>
            </Columns>
            <HeaderStyle Height="26px" HorizontalAlign="Left" CssClass="GridHeader" />
            <RowStyle CssClass="GridRow" Height="23px" />
            <AlternatingRowStyle CssClass="GridAlterRow" />
            <PagerStyle CssClass="GridPaged" HorizontalAlign="Right" Height="23px" />
            <PagerSettings Mode="Numeric" PageButtonCount="2" />
            <EmptyDataRowStyle CssClass="GridTextEmpty" HorizontalAlign="Center" />
        </asp:GridView>
        <div>
            <asp:Button ID="btnCapNhat" CssClass="btn" runat="server" Text="Cập nhật" />
            <asp:Label ID="lblPage_Size" runat="server" Text="Số bản ghi trên trang:"></asp:Label>
            <asp:DropDownList ID="drpPage_Size" runat="server" AutoPostBack="True" Width="70px"
                CssClass="input_form">
                
                <asp:ListItem Text="20" Value="20"></asp:ListItem>
                <asp:ListItem Text="50" Value="50" Selected></asp:ListItem>
                <asp:ListItem Text="100" Value="100"></asp:ListItem>
            </asp:DropDownList>
            <asp:Label ID="lblTotal" runat="server"></asp:Label></div>
        <div style="width: 99%">
            <!--phan trang-->
            <div id="results_resultsNavigationDiv" class="paginationEMP">
                <ul>
                    <asp:LinkButton ID="lnkFirst" runat="server"></asp:LinkButton>
                    <asp:Repeater ID="rptPage" runat="server">
                        <ItemTemplate>
                            <asp:LinkButton ID="lnkTitle" CssClass="page_num" runat="server" OnClick="lnkTitle_Click"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:Repeater>
                    <asp:LinkButton ID="lnkLast" runat="server"></asp:LinkButton>
                </ul>
            </div>
            <asp:HiddenField ID="hidCount" Value="0" runat="server" />
            <asp:HiddenField ID="hidIndex_page" Value="0" runat="server" />
            <asp:HiddenField ID="hidCur_Page" Value="1" runat="server" />
              <asp:HiddenField ID="BranchNewsId" Value="0" runat="server" />
      <asp:HiddenField ID="hidID" Value="0" runat="server" />
        </div>
        <div style='display: none'>
            <asp:DropDownList ID="drpMessage" runat="server">
                <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản ghi này không?' Value='0'></asp:ListItem>
                <asp:ListItem Text='Bạn có chắc chắn muốn xóa bản đã chọn?' Value='1'></asp:ListItem>
                <asp:ListItem Text='Bạn phải chọn ít nhất một bản ghi.' Value='2'></asp:ListItem>
            </asp:DropDownList>
            <asp:HiddenField ID="hidCheckBoxDate" Value="" runat="server" />
        </div>

<%-- Phan danh cho ChangeMenu--%>
<div id="ChangeMenuBox" style="display: none" class="box_popup_login">
    <div class="title_popup_login">
        <div class="icon_title_popup">
            <asp:ImageButton ID="image" CausesValidation="false" OnClientClick="self.parent.tb_remove();"
                ToolTip="Đóng cửa sổ" ImageUrl="~/Control/Messagebox/msbox_image/close_popup.png"
                align="middle" border="0" Width="19" Height="19" runat="server" />
        </div>
    </div>
    <div class="clearboth">
    </div>
    <div class="mid_popup_login">
        <div class="BoxField" style="background-color: #ffffff;">
            <div class="DivRow">
                <div class="DivLabel">
                    <asp:Label ID="lblGroupname" CssClass="TextLabel" runat="server" Text="Ngày checkout: " />
                </div>
                <div class="DivTextBox">
                    <asp:TextBox ID="txtCheckBoxDate" runat="server" CssClass="TextBox Date"></asp:TextBox>
                </div>
                <div class="DivLabel" style="padding-top: 10px">
                    <asp:Button ID="btnSelectMenu" CssClass="btn" runat="server" CausesValidation="False"
                        Text="Chọn" />
                    <input name="btnAcept" type="submit" onclick="self.parent.tb_remove();" value="Hủy"
                        class="btn" />
                </div>
            </div>
        </div>
    </div>
</div>
<div style="display: none">
    <input id="btnShowChangeMenu" alt="#TB_inline?height=120&width=305&modal=true&inlineId=ChangeMenuBox"
        title="add a caption to title attribute / or leave blank" class="thickbox" type="button"
        value="Show" />
</div>

 
    </ContentTemplate>
</asp:UpdatePanel>
